#pragma once
#include <string>
#include "InterestTable.h"
using namespace std;
/** \brief This class handles each person
*
*/
class Person
{
public:

	Person()
	{
	}

	Person(string name){ this->name = name; }

	Person(const Person &p)
	{ 
		this->name = p.name;
		this->interests.clear();
		this->interests = p.interests;
	}

	~Person()
	{
	}

	string getName(){ return name; }

	void add_interest(string interest)
	{
		interests.add_at_head(interest);
	}

	InterestTable<string> getInterests()
	{
		return interests;
	}

	bool checkIfMatch(string interest)
	{
		
		if (interests.search(interest) != nullptr)
			return true;
		else
			return false;
	}

	friend bool operator==(const Person &lop, const Person rop)
	{
		if (lop.name == rop.name)
			return true;
		else
			return false;
	}

private:
	string name;
	InterestTable<string> interests;
};

